/**
 * Copyright 2011-2013 Brin.com
 * All rights reserved.
 * 
 * @project
 * @author Brin
 * @version 1.0
 * @data 2011-08-22
 */
package com.brin.core.http;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.brin.core.http.HttpInclude;

/**
 * 
 * @author Brin
 * @descrption 
 */
public class ShareRenderArgsVariableInterceptor extends HandlerInterceptorAdapter {
	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
		if (modelAndView != null) {
			String viewName = modelAndView.getViewName();
			if(viewName != null && !viewName.startsWith("redirect:")) {
				modelAndView.addObject("httpInclude", new HttpInclude(request, response));
			}
		}
	}
}